|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrolesystem.jade.server.PermissionMatrix
public class PermissionMatrix
This class represents permissions of interactions between roles.
| Nested Class Summary | |
|---|---|
static class |
PermissionMatrix.PMException
Exception of this class are thrown by methods of class PermissionMatrix. |
| Constructor Summary | |
|---|---|
PermissionMatrix()
Constructs a default matrix, with no known roles. |
|
| Method Summary | |
|---|---|
void |
addRole(java.lang.String role)
Adds a new role to the known ones. |
boolean |
checkPermission(java.lang.String senderRole,
java.lang.String addresseeRole)
Checks whether interactions between the specified roles are allowed. |
void |
copy(PermissionMatrix original)
Copies this permission matrix from a specified one. |
java.lang.String[] |
getKnownRoles()
Gets an array filled with all known roles. |
void |
removeRole(java.lang.String role)
Removes a role from the known ones. |
void |
setPermission(java.lang.String senderRole,
java.lang.String addresseeRole,
boolean allow)
Sets permission for interactions between the specified roles. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PermissionMatrix()
| Method Detail |
|---|
public void copy(PermissionMatrix original)
original - Permission matrix to copy.
public void addRole(java.lang.String role)
throws PermissionMatrix.PMException
role - Role to add.
PermissionMatrix.PMException - If the specified role already exists.
public void removeRole(java.lang.String role)
throws PermissionMatrix.PMException
role - Role to remove.
PermissionMatrix.PMException - If the specified role does not exist.
public boolean checkPermission(java.lang.String senderRole,
java.lang.String addresseeRole)
senderRole - Role of the sender.addresseeRole - Role of the addressee.
public void setPermission(java.lang.String senderRole,
java.lang.String addresseeRole,
boolean allow)
throws PermissionMatrix.PMException
senderRole - Role of the sender; null indicates all
unknown roles.addresseeRole - Role of the addressee; null indicates
all unknown roles.allow - true if interactions must be allowed, false
otherwise.
PermissionMatrix.PMException - If one or both of specified roles is not known.public java.lang.String[] getKnownRoles()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||